Skip to content

Add flag to suppress stream errors #6458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nikic
Copy link
Member

@nikic nikic commented Nov 26, 2020

mysqlnd currently sets error_reporting=0 to suppress errors while writing to streams. Unfortunately these errors are still visible to userland error handlers, which is a common source of confusion. See for example https://bugs.php.net/bug.php?id=80412.

This patch instead adds a stream flag to suppress read/write errors, which is set by mysqlnd and respected by the plain & socket streams.

@nikic
Copy link
Member Author

nikic commented Nov 26, 2020

@cmb69 Does this look like a sensible thing to do?

@cmb69
Copy link
Member

cmb69 commented Nov 26, 2020

Probably, yes, but it is slightly confusing to also have REPORT_ERRORS which can be passed as option to some stream functions.

@nikic
Copy link
Member Author

nikic commented Nov 26, 2020

@cmb69 Right. I believe that flag is primarily used when opening streams, in which case we don't yet have a stream on which a flag can be set, so we need to pass it in separately.

@cmb69
Copy link
Member

cmb69 commented Nov 26, 2020

Indeed, and that is even explained in docs/streams.md. So it makes sense to introduce the new flag.

@php-pulls php-pulls closed this in 24a19cc Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants